package com.fss.order.service.impl;

import java.util.List;
import com.fss.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fss.order.mapper.TbOrder1Mapper;
import com.fss.order.domain.TbOrder1;
import com.fss.order.service.ITbOrder1Service;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class TbOrder1ServiceImpl implements ITbOrder1Service 
{
    @Autowired
    private TbOrder1Mapper tbOrder1Mapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public TbOrder1 selectTbOrder1ByOrderId(Long orderId)
    {
        return tbOrder1Mapper.selectTbOrder1ByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param tbOrder1 订单
     * @return 订单
     */
    @Override
    public List<TbOrder1> selectTbOrder1List(TbOrder1 tbOrder1)
    {
        return tbOrder1Mapper.selectTbOrder1List(tbOrder1);
    }

    /**
     * 新增订单
     * 
     * @param tbOrder1 订单
     * @return 结果
     */
    @Override
    public int insertTbOrder1(TbOrder1 tbOrder1)
    {
        tbOrder1.setCreateTime(DateUtils.getNowDate());
        return tbOrder1Mapper.insertTbOrder1(tbOrder1);
    }

    /**
     * 修改订单
     * 
     * @param tbOrder1 订单
     * @return 结果
     */
    @Override
    public int updateTbOrder1(TbOrder1 tbOrder1)
    {
        tbOrder1.setUpdateTime(DateUtils.getNowDate());
        return tbOrder1Mapper.updateTbOrder1(tbOrder1);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteTbOrder1ByOrderIds(Long[] orderIds)
    {
        return tbOrder1Mapper.deleteTbOrder1ByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteTbOrder1ByOrderId(Long orderId)
    {
        return tbOrder1Mapper.deleteTbOrder1ByOrderId(orderId);
    }
}
